<?php /*a:4:{s:69:"D:\laragon\www\ssbeautiful\application\manage\view\examine_index.html";i:1615943448;s:60:"D:\laragon\www\ssbeautiful\application\manage\view\base.html";i:1596192950;s:67:"D:\laragon\www\ssbeautiful\application\manage\view\public_page.html";i:1540951044;s:63:"D:\laragon\www\ssbeautiful\application\manage\view\laypage.html";i:1540951044;}*/ ?>
<!DOCTYPE html>
<html lang="zh-cmn-Hans">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no">
<meta http-equiv="X-UA-Compatible" content="ie=edge,chrome=1">
	<meta name="renderer" content="webkit">
<title>后台管理系统</title>
<link rel="stylesheet" href="/static/public/awesome/css/font-awesome.min.css" />

<link rel="stylesheet" href="/static/public/layui/css/layui.css" />

<link rel="stylesheet" href="/static/public/kindeditor/themes/default/default.css" />
<link rel="stylesheet" href="/static/manage/css/style.css" />

	<link rel="stylesheet" href="/static/public/dist/zoomify.min.css">
	
<script src="/static/public/kindeditor/kindeditor-all.js"></script>
<script src="/static/public/kindeditor/lang/zh_CN.js"></script>
<script src="/static/public/ueditor/ueditor.config.js?t=<?php echo time();?>"></script>
<script src="/static/public/ueditor/ueditor.all.min.js"></script>
<script src="/static/public/ueditor/lang/zh-cn/zh-cn.js"></script>
</head>
<body>
<?php if($is_auth): ?>

<div class="g-main">
    <div class="m-main-title">
        <div class="m-container-fluid">
            <a href="<?php echo url('index/welcome'); ?>"><i class="icon icon-home"></i>首页</a>
            <span class="icon-angle-right"></span>
            <span>门店管理</span>
            <span class="icon-angle-right"></span>
            <span>门店管理</span>
            <span class="icon-angle-right"></span>
            <span>店员列表</span>
            <a class="u-flush"><i class="icon-repeat"></i></a>
        </div>
    </div>
    <div class="m-main-content">
        <div class="m-container">

            <form class="layui-form">
                <table class="m-table mt-10">
                    <tbody class="datas">
                    <tr>
                        <!--                        <th width="5%" style="text-align: center;">选择</th>-->
                        <th width="5%">ID</th>
                        <th>用户姓名</th>
                        <th>用户手机号</th>
                        <th>操作积分</th>
                        <th>操作类型</th>
                        <th>操作人员(账号/姓名)</th>
                        <th>所属店铺</th>
                        <th>审核状态</th>
                        <th>创建时间</th>
                        <th  width="10%">操作</th>
                    </tr>
                    <?php if(is_array($data) || $data instanceof \think\Collection || $data instanceof \think\Paginator): if( count($data)==0 ) : echo "" ;else: foreach($data as $key=>$v): ?>
                    <tr>
                        <td><?php echo htmlentities($v['id']); ?></td>
                        <td><?php echo htmlentities($v['member_info']['username']); ?></td>
                        <td><?php echo htmlentities($v['member_info']['mobile']); ?></td>
                        <td><?php echo htmlentities($v['points']); ?></td>
                        <td><?php echo !empty($v['type']) ? "扣除积分"  :  "新增积分"; ?></td>
                        <td><?php echo htmlentities($v['user_info']['username']); ?>/<?php echo htmlentities($v['user_info']['real_name']); ?></td>
                        <td><?php echo htmlentities($v['user_info']['stores_name']); ?></td>
                        <td><?php echo !empty($v['status']) ? "通过"  :  "未通过"; ?></td>
                        <td><?php echo htmlentities($v['created_at']); ?></td>
                        <td class="m-opt">
                            <?php if($v['status'] == 0): ?>
                            <button type="button" data-id="<?php echo htmlentities($v['id']); ?>"	class="layui-btn layui-btn-xs">通过</button>
                            <button type="button" data-id="<?php echo htmlentities($v['id']); ?>" class="layui-btn layui-btn-xs layui-btn-danger">驳回</button>
                            <?php else: ?>
                            暂无操作
                            <?php endif; ?>
                        </td>
                    </tr>
                    <?php endforeach; endif; else: echo "" ;endif; ?>

                </table>
            </form>
            <?php if($count): ?>
<div class="m-pages mt-10">
    <div class="m-overview fl">共 <?php echo htmlentities($count); ?> 条，<?php echo htmlentities($page); ?>/<?php echo ceil($count/$limit); ?></div>
    <div class="fl" id="page"></div>
</div>
<?php endif; ?>
        </div>
    </div>
</div>

<?php endif; ?>
<input type="hidden" name="action_uri" value="<?php echo url('action'); ?>" />

<input type="hidden" name="redirect_uri" value="<?php echo url('index'); ?>" />

<input type="hidden" name="region_uri" value="/manage/regions/regions" />
<script src="/static/public/js/jquery-1.10.2.js"></script>
<script src="/static/public/js/maniac.ui.js"></script>
<script src="/static/public/layui/layui.js" charset="utf-8"></script>
<script src="/static/public/js/aes.js"></script>
<script src="/static/public/js/mode-ecb-min.js"></script>
<script src="/static/public/js/utils.js"></script>
<script src="/static/public/js/dialog.js"></script>
<script src="/static/manage/js/form.js"></script>
<script src="/static/manage/js/js.js"></script>
<script src="/static/public/js/app.js"></script>
<script src="/static/public/js/encrypt.js"></script>
<script src="/static/public/dist/zoomify.min.js"></script>
<script type="text/javascript">
    $('.fdzoom').zoomify();
</script>

<script>
var aesKey = '<?php echo htmlentities($encrypt_key); ?>';
    $(function(){
        layui.use('layer', function(){
            var user_exists = parseInt('<?php echo !empty($user_exists) ? 1  :  0; ?>');
            var user_forbidden = parseInt('<?php echo !empty($user_forbidden) ? 1  :  0; ?>');
            var quit_force = parseInt('<?php echo !empty($quit_force) ? 1  :  0; ?>');
            var is_auth    = parseInt('<?php echo !empty($is_auth) ? 1  :  0; ?>');
            
            if (user_exists) {
                dialog.error('您所登录的用户已被删除', function(){
                	top.location.href = '/manage';
                    return false;
                });
            }
            
            if (user_forbidden) {
                dialog.error('您的账户已被禁用', function(){
                	top.location.href = '/manage';
                    return false;
                });
            }

            if (quit_force) {
                dialog.error('同一账户同一时间只能一人在线', function(){
                	top.location.href = '/manage';
                    return false;
                });
            }
            
            if (!is_auth) {
                dialog.error('您没有权限执行此操作', function(){
                    window.location.href = history.go(-1);
                    return false;
                });
            }
        });
    })
</script>

<script>
layui.use('laypage', function(){
    var laypage = layui.laypage;

    // 执行一个laypage实例
    laypage.render({
        elem: 'page', // 注意，这里的 page 是 ID，不用加 # 号
        count: '<?php echo htmlentities($count); ?>',     // 数据总数，从服务端得到
        limit: '<?php echo htmlentities($limit); ?>',        // 每页显示的条数。laypage 将会借助 count 和 limit 计算出分页数。
        curr: '<?php echo htmlentities($page); ?>',    // 起始页。
        groups: 10,        // 连续出现的页码个数
        first: '首页',
        last: '尾页',
        prev: '<em>←</em>',
        next: '<em>→</em>',
        theme: '#337AB7',    // 自定义主题。支持传入：颜色值，或任意普通字符。
        jump: function(obj, first){
            // obj 包含了当前分页的所有参数，比如：
            // obj.curr: 得到当前页，以便向服务端请求对应页的数据。
            // obj.limit: 得到每页显示的条数
            // 首次不执行
            if (!first) {
                var href = location.href.replace(/[?|&]page=\d*/, '');
                var and  = href.indexOf('?') == -1 ? '?' : '&';
                window.location.href = href + and + 'page=' + obj.curr;
            }
        }
    });
});
</script>
<script>
    $(function(){
        //通过
        $(".layui-btn-xs").click(function () {
            var id = $(this).attr("data-id");
            layer.confirm('确定执行此操作吗?', {icon: 3, title:'提示'}, function(index){
                $.post("/manage/examine/adopt",{
                    id : id
                },function (res) {
                    if (!res.status){
                        dialog.success(res.message,function(){
                            layer.close(index);
                            window.location.reload();
                        })
                    }else{
                        dialog.error(res.message,function(){
                            layer.close(index);
                            window.location.reload();
                        })
                    }
                });
                layer.close(index);
            });
        })
        //驳回
        $(".layui-btn-danger").click(function () {
            var id = $(this).attr("data-id");
            layer.confirm('确定执行此操作吗?', {icon: 3, title:'提示'}, function(index){
                $.post("/manage/examine/reject",{
                    id : id
                },function (res) {
                    if (!res.status){
                        dialog.success(res.message,function(){
                            layer.close(index);
                            window.location.reload();
                        })
                    }else{
                        dialog.error(res.message,function(){
                            layer.close(index);
                            window.location.reload();
                        })
                    }
                });
                layer.close(index);
            });
        })
    })
</script>

</body>
</html>